/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.cast.teseg.gui;

import java.awt.*;
import javax.swing.*;
/**
 *
 * @author edgarin
 */
public class InicioGUI extends JFrame{
    final static int interval = 1000;
    private JPanel inicioGui;
    private JLabel imageLb;
    private final ImageIcon img;
    private JProgressBar progressBar;
    private Timer temporizador;
    private int totalEventos;
    private final int max=100;
    private int valor=0;
    
    public InicioGUI(){
        
        //temporizador= new Timer(2000, this);
       // temporizador.start();
                  
        inicioGui = new JPanel();        
        imageLb = new JLabel();
        img = new ImageIcon( getClass().getResource( "imagenes/logo.jpg" ) );
        imageLb.setIcon(img);
        
        progressBar = new JProgressBar();
        progressBar.setValue(0);
        progressBar.setStringPainted(true);
        inicioGui.setOpaque(true);
        inicioGui.add(imageLb, BorderLayout.SOUTH);
        inicioGui.add(progressBar, BorderLayout.CENTER);
        getContentPane().add(inicioGui, BorderLayout.CENTER);        
        
    }
    public void startTime(){
        progressBar.setMaximum(100);
        
        while(valor<max) {            
            valor++;
            progressBar.setValue(valor);            
        }
        
        inicioGui.updateUI();
    
  }

    public JProgressBar getProgressBar() { return progressBar; }

    public int getMax() { return max; }
    
    
    
    //**** metodo para iniciar el frame ****//
    public void crearGui(){          
        
        this.pack();
        this.setVisible(true);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(800,700);
        this.setResizable(false);
        this.setLocationRelativeTo(null);       
    }

   
}
